package com.hogocloud.myframe.ui

import android.os.Bundle
import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager
import com.hogocloud.corelibrary.base.BaseFragment
import com.hogocloud.corelibrary.common.drawerview.ViewState
import com.hogocloud.myframe.R
import kotlinx.android.synthetic.main.fragment_dash_board.*

/**
 * class
 *
 * @author gjc
 * @version 1.0.0
 * @since 2019-08-01
 */
class DashBoardFragment : BaseFragment() {

    override fun initLayout(): Int {
        return R.layout.fragment_dash_board
    }

    override fun initView(view: View, savedInstanceState: Bundle?) {
        val myAdapter = MyAdapter(R.layout.item_text, listOf())
        rv_test.layoutManager = LinearLayoutManager(mContext)
        rv_test.adapter = myAdapter

        myAdapter.setNewData(
            listOf(
                "1", "2", "3", "4", "5",
                "6", "7", "8", "9", "10",
                "11", "12", "13", "14", "15",
                "16", "17", "18", "19", "20"
            )
        )

        btn_open.setOnClickListener {
            if (dv_content.state === ViewState.CLOSE)
            // "关闭" 状态
                dv_content.changeState(ViewState.HOVER)   // 打开至 "悬停" 状态
            else
                dv_content.changeState(ViewState.CLOSE)//                    mHv.changeState(ViewState.FILL);   // 打开至 "全屏" 状态
            // 切换至 "关闭" 状态
        }
    }


}